import base.PipeWriter
import base.impl.PipeFileOutputStream

fun main(args: Array<String>) {

    for (time in 1..5) {
        val pipeFileWriter =
            PipeWriter<LocationInfo>(20, PipeFileOutputStream("/Users/guojie/Documents/tet/abx$time.txt"))

        pipeFileWriter.start()

        Thread {
            for (i in 1..1009) {
                pipeFileWriter.addElement(LocationInfo(i.toDouble(), i.toDouble(), "用于遍历数字范围"))
            }

        }.start()

        Thread.sleep(3000)
        pipeFileWriter.stop()
    }
}